RatingProjectSetGridForm = Ext.extend(Ext.Window, {
    constructor : function(a) {
        Ext.applyIf(this, a);
        this.initUIComponents();
        RatingProjectSetGridForm.superclass.constructor.call(this, {
            id : "RatingProjectSetGridFormWin",
            iconCls : "menu-department",
            layout : "fit",
            items : this.formPanel,
            modal : true,
            height : 220,
            minHeight : 220,
            width : 600,
            minWidth : 500,
            maximizable : true,
            title : this.name == null ? "新增/编辑详细信息" : "新增/编辑[" + this.name + "]详细信息",
            buttonAlign : "center",
            buttons : [ {
                text : "保存",
                iconCls : "btn-save",
                scope : this,
                handler : this.save
            }, {
                text : "取消",
                iconCls : "btn-cancel",
                scope : this,
                handler : this.cancel
            } ],
            keys : {
                key : Ext.EventObject.ENTER,
                fn : this.save,
                scope : this
            }
        });
    },
    initUIComponents : function() {
        this.formPanel = new Ext.FormPanel({
            id : "RatingProjectSetGridForm",
            layout : "form",
            border : false,
            autoScroll : true,
            items : [ {
                name : "ratingProjectSet.id",
                xtype : "hidden",
                value : this.id == null ? "" : this.id
            }, {
                name : "ratingProjectSet.ratingProjectSetTreeId",
                xtype : "hidden",
                value : this.ratingProjectSetTreeId == null ? "" : this.ratingProjectSetTreeId
            }, {
                layout : 'column',
                bodyStyle : "padding:5px;",
                border : false,
                items : [ {
                    layout : 'form',
                    bodyStyle : 'padding:5px;',
                    columnWidth : .5,
                    border : false,
                    items : [ {
                        xtype : 'textfield',
                        fieldLabel : '一级要素<font color="red">*</font>',
                        name : 'ratingProjectSet.oneLevel',
                        width : 146,
                        allowBlank : false,
                        maxLength : 100
                    } ]
                }, {
                    layout : 'form',
                    bodyStyle : 'padding:5px;',
                    border : false,
                    columnWidth : .5,
                    items : [ {
                        xtype : 'textfield',
                        fieldLabel : '二级要素<font color="red">*</font>',
                        name : 'ratingProjectSet.twoLevel',
                        allowBlank : false,
                        width : 146,
                        maxLength : 200
                    } ]
                }, {
                    layout : 'form',
                    bodyStyle : 'padding:5px;',
                    border : false,
                    columnWidth : .5,
                    items : [ {
                        xtype : 'textfield',
                        name : 'ratingProjectSet.regulation',
                        fieldLabel : '基本规范要求',
                        width : 146,
                        maxLength : 100
                    } ]
                }, {
                    layout : 'form',
                    bodyStyle : 'padding:5px;',
                    border : false,
                    columnWidth : .5,
                    items : [ {
                        xtype : 'textfield',
                        name : 'ratingProjectSet.baseStandard',
                        fieldLabel : '企业达标标准',
                        width : 146,
                        maxLength : 100
                    } ]
                }, {
                    layout : 'form',
                    bodyStyle : 'padding:5px;',
                    border : false,
                    columnWidth : .5,
                    items : [ {
                        xtype : 'textfield',
                        name : 'ratingProjectSet.standardScore',
                        fieldLabel : '标准分值',
                        width : 146,
                        maxLength : 100
                    } ]
                }]
            } ]
        });
        if (this.id != null && this.id != "undefined") {
            this.formPanel.loadData({
                url : __ctxPath + "/safeachievements/getdetailRatingProjectSet.do?id=" + this.id,
                root : "result",
                preName : "ratingProjectSet"
            });
        }
    },
    cancel : function() {
        this.close();
    },
    save : function() {
        var a = Ext.getCmp("RatingProjectSetGridForm");
        if (a.getForm().isValid()) {
            a.getForm().submit({
                url : __ctxPath + "/safeachievements/saveRatingProjectSet.do",
                waitMsg : "数据正在提交，请稍后...",
                method : "post",
                success : function() {
                    Ext.getCmp("RatingProjectSetView").getStore().reload();
                    Ext.ux.Toast.msg("操作提示", "数据操作成功！");
                    Ext.getCmp("RatingProjectSetGridFormWin").close();
                },
                failure : function(b, d) {
                    var c = Ext.util.JSON.decode(d.response.responseText);
                    Ext.ux.Toast.msg("操作提示", c.msg);
                }
            });
        }
    }
});